import axios from '@/utils/axios'

// 频道新闻列表
export const articleinfo = params => {
    return axios({
        method: 'GET',
        url: '/v1_0/articles',
        params // 接受的参数是一个对象
    })
};

// 获取文章详情数据
export const getArticleById = articleId => {
    return axios({
        method: 'GET',
        url: `/v1_0/articles/${articleId}`,
    })
};
/**
 * 收藏文章
 */
export const addCollect = target => {
    return axios({
        method: 'POST',
        url: '/v1_0/article/collections',
        data: {
            target
        }
    })
};

/**
 * 取消收藏文章
 */
export const deleteCollect = target => {
    return axios({
        method: 'DELETE',
        url: `/v1_0/article/collections/${target}`
    })
}